#pragma once

#ifdef E2D_BUILD_TRANS
#include "e2d/core/trans/TransformHandler.h"
#endif
#ifdef E2D_BUILD_RENDER
#include "e2d/core/render/SpriteRenderer.h"
#endif
#ifdef E2D_BUILD_AUDIO
#include "e2d/core/audio/AudioSystem.h"
#endif
#ifdef E2D_BUILD_PHYSICS
#include "e2d/core/physics/PhysicsSystem.h"
#endif
#ifdef E2D_BUILD_FUI

#endif

#include "e2d/core/impl/ScriptSystem.h"
#include "e2d/core/impl/PrefebManager.h"


namespace e2d
{
	struct GameManager
	{
#ifdef E2D_BUILD_TRANS
		std::shared_ptr<e2d::TransformHandler> m_TransformHandler;
#endif
#ifdef E2D_BUILD_RENDER
		std::shared_ptr<e2d::SpriteRenderer> m_SpriteRenderer;
#endif
#ifdef E2D_BUILD_AUDIO
		std::shared_ptr<e2d::AudioSystem> m_AudioSystem;
#endif
#ifdef E2D_BUILD_PHYSICS
		std::shared_ptr<e2d::PhysicsSystem> m_PhysicsSystem;
#endif
#ifdef E2D_BUILD_FUI

#endif

		std::shared_ptr<e2d::ScriptSystem> m_ScriptSystem;

		std::shared_ptr<e2d::PrefebManager> m_PrefebManager;

		e2d::Timer* m_Timer{ 0 };

		e2d::Input* m_Input{ 0 };

		GameManager();

		void Init();

		void OnLoad();

		void OnLoadResources();

		void OnLoadPrefebs();

		void OnLoadScripts();

		void OnStart();

		void OnRender();

		void OnRenderRuntime();

		void OnUpdate();

		void OnUpdateRuntime();

		void OnDestory();

		void OnFramebuffersize(const glm::ivec2& sz);

		void SetScene(std::shared_ptr<e2d::Scene> scene);

		void SetTimerAndInput(e2d::Timer* timer, e2d::Input* input);

		~GameManager();
	};

};